<?php
namespace app\components;

use Yii;
use yii\base\Component;
use EasyWeChat\Factory;

class MiniProgram extends Component
{

    public $config;

    public $app;

    public function __construct($config = [])
    {
        if($config){
             $this->config=$config['config'];
        }
        $this->miniProgram($this->config);
        return $this->app;
    }

    public function miniProgram($config)
    {
        $this->app = Factory::miniProgram($config);
        return $this->app;
    }
}
